const KEY = "🎈token"

export function setToken(value) {
    localStorage.setItem(KEY, value)
}

export function getToken() {
    return localStorage.getItem(KEY)
}

/**
 * 清除token以及相关菜单、路由、用户信息
 */
export function clearToken() {

    return new Promise((resolve, reject) => {
        localStorage.removeItem(KEY)
        localStorage.removeItem('menus')
        localStorage.removeItem('routes')
        localStorage.removeItem('profile')
        resolve()
    })


}
